package com.pattern.observer;
/**
 * 观察者模式：观察者对象
 * @author liuxiaodong
 *
 */
public class ObserverImpl implements Observer {
	
	private String name;
	public ObserverImpl(String name){
		this.name = name;
	}
	
	public ObserverImpl(){
	}
	
	@Override
	public void update(Subject subject) {
		System.out.println(name+"接收到消息："+((SubjectImpl)subject).getMessage());
	}

}
